Skip to content

feat: drop rule groups Ruff 0.16 selects by default - #843

Merged
henryiii merged 3 commits into
mainfrom
chore/ruff-016-defaults
Aug 12, 2026
Merged

feat: drop rule groups Ruff 0.16 selects by default#843
henryiii merged 3 commits into
mainfrom
chore/ruff-016-defaults

Conversation

@henryiii

@henryiii henryiii commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Ruff 0.16 turns on 413 rules without configuration. Compared the default set against the full rule index: BLE, DTZ, FA, FLY, INT, PIE, and YTT are fully covered (including preview rules), and I is covered except for I002, which needs the lint.isort.required-imports setting. No other group is fully covered.

  • Removed these groups from the cookie's extend-select and from both example configs in the style guide.
  • Removed the RF102 check ("isort must be selected"). RF101 (B) and RF103 (UP) stay, because those groups are not fully default.
  • sp-ruff-checks no longer suggests the default groups under "Unselected". If a config still selects one, it is now listed under "Selected, but on by default (safe to remove)".

linter.json is unchanged: Ruff 0.16 adds and removes no linter prefixes.


📚 Documentation preview 📚: https://scientific-python-cookie--843.org.readthedocs.build/

Ruff 0.16 enables 413 rules without configuration. `BLE`, `DTZ`, `FA`,
`FLY`, `INT`, `PIE`, and `YTT` are fully covered, and `I` is covered
except for `I002`, which needs the `required-imports` setting.

Remove these from the cookie and the style guide, remove the `RF102`
check, and teach `sp-ruff-checks` to report them as safe to remove
instead of suggesting them.

Assisted-by: ClaudeCode:claude-opus-5
@henryiii

Copy link
Copy Markdown
Collaborator Author

Here's the B and UP rules that are not selected by default still:

🤖 AI text below 🤖

Checked against ruff 0.16.2 (--show-settings enabled list vs ruff rule --all).

B (flake8-bugbear): 43 rules, 29 on by default, 14 not.

Stable rules you only get by selecting B:

Code Rule
B007 unused-loop-control-variable
B011 assert-false
B024 abstract-base-class-without-abstract-method
B027 empty-method-without-abstract-decorator
B028 no-explicit-stacklevel
B034 re-sub-positional-args
B904 raise-without-from-inside-except
B905 zip-without-explicit-strict
B911 batched-without-explicit-strict
B912 map-without-explicit-strict

Preview-only, so selecting B still does not turn them on: B043, B901, B903, B909.

UP (pyupgrade): 48 rules, 42 on by default, 6 not.

Stable gains: UP013 (convert-typed-dict-functional-to-class), UP015 (redundant-open-modes), UP042 (replace-str-enum).
Preview-only: UP051. Removed from ruff entirely: UP027 (0.8.0), UP038 (0.13.0).

henryiii and others added 2 commits August 11, 2026 23:34
Ruff 0.16 selects 42 of the 48 `UP` rules without configuration. Selecting
the group is still useful for the three stable rules it adds (`UP013`,
`UP015`, and `UP042`), so keep the suggestion in the style guide and in
`sp-ruff-checks`, but stop reporting it as a required setting.

Assisted-by: ClaudeCode:claude-opus-5
@henryiii
henryiii merged commit 8cb7ff0 into main Aug 12, 2026
33 checks passed
@henryiii
henryiii deleted the chore/ruff-016-defaults branch August 12, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant